package com.dunke.core.common;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 记录用户Token
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TokenData implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Integer id;
    /**
     * 账号
     */
    private String account;

    /**
     * 密码
     */
    private String password;

    /**
     * Token
     */
    private String token;

    /**
     * Token 生成的时间
     */
    private long createTime;

    public TokenData(Integer id, String account, String password) {
        this.id = id;
        this.account = account;
        this.password = password;
    }

    public TokenData(Integer id, String account, String password, long createTime) {
        this.id = id;
        this.account = account;
        this.password = password;
        this.createTime = createTime;
    }

    public TokenData(Integer id, String account, String password, String token, long createTime) {
        this.id = id;
        this.account = account;
        this.password = password;
        this.token = token;
        this.createTime = createTime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "TokenData{" +
                "id=" + id +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                ", token='" + token + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
